package com.htc.android.footprints.activity;

import android.content.DialogInterface;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.preference.CheckBoxPreference;
import android.preference.Preference;
import android.preference.PreferenceActivity;
import android.preference.PreferenceScreen;

import com.htc.android.footprints.utils.SettingInfo;

public class SettingActivity extends PreferenceActivity
{
  private Preference mResetSerialNumber;
  private CheckBoxPreference mRetrieveAddress;
  private SettingInfo mSetting = SettingInfo.getInstance(this);
  private SharedPreferences mSettingDb;
  private CheckBoxPreference mShowConnectionFailedAlert;
  private CheckBoxPreference mShowLocationDisabledAlert;

  protected void onCreate(Bundle paramBundle)
  {
    super.onCreate(paramBundle);
    setContentView(2130903076);
    addPreferencesFromResource(2131034112);
    this.mSettingDb = getSharedPreferences("FootprintsSetting", 2);
    this.mRetrieveAddress = ((CheckBoxPreference)findPreference("pref_retrieve_address"));
    this.mShowLocationDisabledAlert = ((CheckBoxPreference)findPreference("pref_show_location_disabled_alert"));
    this.mShowConnectionFailedAlert = ((CheckBoxPreference)findPreference("pref_show_connection_failed_alert"));
    this.mResetSerialNumber = findPreference("pref_serial_number");
    this.mRetrieveAddress.setChecked(this.mSetting.retrieveAddress);
    this.mShowLocationDisabledAlert.setChecked(this.mSetting.showLocationDisabledAlert);
    this.mShowConnectionFailedAlert.setChecked(this.mSetting.showConnectionFailedAlert);
  }

  protected void onDestroy()
  {
    super.onDestroy();
  }

  public boolean onPreferenceTreeClick(PreferenceScreen paramPreferenceScreen, Preference paramPreference)
  {
    boolean bool;
    if (paramPreference == this.mRetrieveAddress)
    {
      bool = this.mRetrieveAddress.isChecked();
      if (bool)
        new HtcAlertDialog.Builder(this).setTitle(getString(2131361946)).setIcon(2130837677).setMessage(getString(2131361947)).setPositiveButton(2131361893, new DialogInterface.OnClickListener(bool)
        {
          public void onClick(DialogInterface paramDialogInterface, int paramInt)
          {
            SettingActivity.this.mSetting.retrieveAddress = this.val$checked;
            SettingActivity.this.mSettingDb.edit().putBoolean("pref_retrieve_address", this.val$checked).commit();
            paramDialogInterface.dismiss();
          }
        }).setNegativeButton(2131361796, new DialogInterface.OnClickListener()
        {
          public void onClick(DialogInterface paramDialogInterface, int paramInt)
          {
            SettingActivity.this.mRetrieveAddress.setChecked(false);
            paramDialogInterface.dismiss();
          }
        }).show();
    }
    while (true)
    {
      return false;
      this.mSetting.retrieveAddress = bool;
      this.mSettingDb.edit().putBoolean("pref_retrieve_address", bool).commit();
      continue;
      if (paramPreference == this.mShowLocationDisabledAlert)
      {
        this.mSetting.showLocationDisabledAlert = this.mShowLocationDisabledAlert.isChecked();
        this.mSettingDb.edit().putBoolean("pref_show_location_disabled_alert", this.mSetting.showLocationDisabledAlert).commit();
        continue;
      }
      if (paramPreference == this.mShowConnectionFailedAlert)
      {
        this.mSetting.showConnectionFailedAlert = this.mShowConnectionFailedAlert.isChecked();
        this.mSettingDb.edit().putBoolean("pref_show_connection_failed_alert", this.mSetting.showConnectionFailedAlert).commit();
        continue;
      }
      if (paramPreference != this.mResetSerialNumber)
        continue;
      new HtcAlertDialog.Builder(this).setTitle(2131361841).setIcon(2130837677).setMessage(2131361843).setPositiveButton(2131361893, new DialogInterface.OnClickListener()
      {
        public void onClick(DialogInterface paramDialogInterface, int paramInt)
        {
          SettingActivity.this.mSetting.resetSerialNumber();
          paramDialogInterface.dismiss();
        }
      }).setNegativeButton(2131361796, null).show();
    }
  }
}

/* Location:           E:\workspace\dex2java\dex-translator-0.0.9.3\HtcFootprints_dex2jar.jar
 * Qualified Name:     com.htc.android.footprints.activity.SettingActivity
 * JD-Core Version:    0.6.0
 */